package com.jt.safe.ui.adpter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.jt.safe.R
import com.jt.safe.entity.SelectStudentBean
import com.jt.safe.extension.setVisible

class SelectStudentAdapter :
    BaseQuickAdapter<SelectStudentBean, BaseViewHolder>(R.layout.select_student_item) {

    override fun convert(helper: BaseViewHolder, item: SelectStudentBean) {
        val name = helper.getView<TextView>(R.id.name)
        helper.getView<ImageView>(R.id.flag).setVisible(item.flag)
        name.text = item.name
        if (item.flag) {
            name.setTextColor(mContext.resources.getColor(R.color.theme))
        } else {
            name.setTextColor(mContext.resources.getColor(R.color.black))
        }
    }
}